1.
Question 1
Where does the following JavaScript code execute?

		<p>One Paragraph</p> 
		<script type="text/javascript"> 
		document.write("<p>Hello World</p>") 
		</script> 
		<p>Second Paragraph</p>

ANS:	In the browser



2.
Question 2
What happens when JavaScript runs the alert() function?

ANS:	JavaScript execution is paused and a dialog box pops up



3.
Question 3
Which of the following is not a way to include JavaScript in an HTML document?

ANS:	By including the code the <?javascript and ?\> tags


4.
Question 4
In the following code, what does the "return false" accomplish?

ANS:	It keeps the browser from following the href attribute when "Click Me" is clicked


5.
Question 5
What happens in a normal end-user's browser when there is a JavaScript error?

ANS:	Nothing except perhaps a small red error icon that is barely noticeable



6.
Question 6
Where can a developer find which line in a web page of JavaScript file is causing a syntax error?

ANS:	In the developer console in the browser



7.
Question 7
What does the following JavaScript do?

		console.log("This is a message");

ANS:	Puts the message in the browser developer console and continues JavaScript execution



8.
Question 8
Which of the following is not a valid comment in JavaScript?

ANS:	# This is a comment



9.
Question 9
Which of the following is not a valid JavaScript variable name?

ANS:	3peat



10.
Question 10
What is the difference between strings with single quotes and double quotes in JavaScript?

ANS:	There is no difference



11.
Question 11
What does the following JavaScript print out?

		toys = ['bat', 'ball', 'whistle', 'puzzle', 'doll'];
		console.log(toys[1]);

ANS:	ball



12.
Question 12
What value ends up in the variable x when the JavaScript below is executed?

		x = 27 % 2;

ANS:	1



13.
Question 13
What is the meaning of the "triple equals" operator (===) in JavaScript?

ANS:	That the values being compared are the same without any type conversion



14.
Question 14
How do you indicate that a variable reference within a JavaScript function is a global (i.e. not local) variable?

ANS:	Nothing, simply declare the variable globally before the function definition in the code

